package com.formina.engine;

import java.util.ArrayList;
import java.util.List;

import javax.microedition.khronos.opengles.GL10;

public class Effect extends Model {

	protected List<Model> particles = new ArrayList<Model>();
	protected long started;
	
	public Effect(float[] location, float[] scale) {
		super(location, scale,Engine.StarParticle);
	}
	
	@Override
	public void update(long time){
		if(started == 0){
			started = time;
		}
		
		if(time >started+2000){
			isDead = true;
		}
	}
	
	@Override
	public void draw(GL10 gl){
		for(int x= particles.size()-1; x>=0;x--){
			particles.get(x).draw(gl);
		}
	}
	
	public List<Model> getParticles(){
		return particles;
	}
}
